package com.example.computer_exam_training_sys.controller;

import com.example.computer_exam_training_sys.service.AdminUserLogVOService;
import com.example.computer_exam_training_sys.vo.AdminUserLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin-user-logs")
@CrossOrigin
public class AdminUserLogVOController {

    @Autowired
    private AdminUserLogVOService adminUserLogVOService;

    /**
     * 查询管理员及其关联用户和所有日志
     */
    @GetMapping("/admin/{adminId}")
    public ResponseEntity<java.util.List<AdminUserLogVO>> findAdminUserAndLogs(@PathVariable Integer adminId) {
        java.util.List<AdminUserLogVO> voList = adminUserLogVOService.findAdminUserAndLogs(adminId);
        return ResponseEntity.ok(voList);
    }
}
